LassoScript Utility
Basics Browse Detail

[String->Trim]

Tag Link [String->Trim] Category String
Type Member Source Available No
Support Preferred Version 5.0
Change Unchanged Data Source Any
Output Type None (Modifies in place) Security None
Implementation LCAPI Sets Lasso 8.5, Lasso 8.0, Lasso 7.0, Lasso 6.0, Lasso 5.0

Description

[String->Trim] removes all white space from the start and end of the string. Modifies the string in place and returns no value.

All spaces, return characters, new lines, and tabs are removed from both the start and end of the string.

Syntax

[String Variable->(Trim)]

Parameters

No Parameters Required.

Examples

To trim extra white space from user input:

Use the [String->Trim] tag. The following example shows how to trim extra white space from the beginning and end of a value returned by [Action_Param: 'First_Name']. The variable First_Name will contain the same value, but without any extraneous spaces or return characters.

[Var: 'First_Name'=(Action_Param: 'First_Name')]
[(Var:'First_Name')->(Trim)]
<br>"[Action_Param: 'First_Name']"
<br>"[Var:'First_Name']"

<br>"  John  "
<br>"John"

Related Tags

Category Tags